<template>
	<!-- 首页轮播 -->
	<swiper autoplay :interval="5000">
		<swiper-item v-for="(item ,index) in carouselList" :key="index">
			<image class="swiper-image" :src="item.img" mode="aspectFill" @click="onClick(item.goodsId)"></image>
		</swiper-item>
	</swiper>
</template>aspectFill

<script>
	export default {
		name: 'homeSwipe',
		props: {
			carouselList: Array
		},
		methods: {
			onClick(goodsId) {
				uni.navigateTo({
					url: `/pages/goods/goodsDetail?goodsId=${goodsId}`
				})
			},
		}
	};
</script>

<style lang="scss" scoped>
	.swiper-image {
		width: 100%;
		height: 100%;
	}
</style>